<!doctype html>
<html lang="en" class="login-content" data-ng-app="materialAdmin" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"></meta>
    <title th:text="${application.propertyMap['k1']}+'-管理员登录界面'"></title>
    <!-- Vendor CSS -->
    <link href="/css/login/css/material-design-iconic-font/css/material-design-iconic-font.min.css" rel="stylesheet" type="text/css"></link>
    <!-- CSS -->
    <link href="/css/login/css/app.min.1.css" rel="stylesheet" type="text/css"></link>
    <script type="text/javascript">

        function submitData(){
            var username=$("#username").val();
            var password=$("#password").val();
            if(username==""){
                alert("请输入用户名！");
                return;
            }
            if(password==""){
                alert("请输入密码！");
                return;
            }
            document.getElementById("fm").submit();
        }


    </script>
</head>
<body class="login-content" data-ng-controller="loginCtrl as lctrl">
<div class="lc-block" id="l-login" data-ng-class="{'toggled':lctrl.login === 1}">
    <form id="fm" action="/login" method="post">
        <h1 class="lean">login</h1>
        <div class="input-group m-b-20">
	    		<span class="input-group-addon">
	    			<i class="zmdi zmdi-account"></i>
	    		</span>
            <div class="fg-line">
                <input autocomplete="off" type="text" value=""  id="username" name="username" class="form-control" placeholder="userName" regex="^\w{3,16}$"/>
            </div>
        </div>

        <div class="input-group m-b-20">
	    		<span class="input-group-addon">
	    			<i class="zmdi zmdi-male"></i>
	    		</span>
            <div class="fg-line">

                <input autocomplete="off" type="password"  id="password" name="password" class="form-control" placeholder="password" regex="^\w+"/>
            </div>
        </div>

        <div class="clearfix"></div>
        <div th:if="${param.error}">
            <font color="red">用户名或者密码错误!</font>
        </div>



        <a href="javascript:submitData()" class="btn btn-login btn-danger btn-float">
            <i class="zmdi zmdi-arrow-forward"></i>
        </a>

    </form>
</div>

</body>

<script src="/css/login/js/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/css/login/js/log.js"></script>
<!-- Angular -->
<script src="/css/login/js/bower_components/angular/angular.min.js"></script>
<script src="/css/login/js/bower_components/angular-resource/angular-resource.min.js"></script>
<script src="/css/login/js/bower_components/angular-animate/angular-animate.min.js"></script>


<!-- Angular Modules -->
<script src="/css/login/js/bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="/css/login/js/bower_components/angular-loading-bar/src/loading-bar.js"></script>
<script src="/css/login/js/bower_components/oclazyload/dist/ocLazyLoad.min.js"></script>
<script src="/css/login/js/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>

<!-- Common js -->
<script src="/css/login/js/bower_components/angular-nouislider/src/nouislider.min.js"></script>
<script src="/css/login/js/bower_components/ng-table/dist/ng-table.min.js"></script>


<script src="/css/login/js/app.js"></script>
<script src="/css/login/js/controllers/main.js"></script>
<script src="/css/login/js/controllers/ui-bootstrap.js"></script>


<!-- Template Modules -->
<script src="/css/login/js/modules/form.js"></script>

<script type="text/javascript">

    $(function(){
        if(self!=top){  // 判断当前页面是否是顶层页面
            var topWindow=window; // 定义最顶层页面  把当前页面赋值给topWindow
            while(topWindow.parent!=topWindow){  // 不断的循环 把当前页面的父页面与顶层页面对象比较 直到相同
                topWindow=topWindow.parent;
            }
            topWindow.location.href="/login"; // 顶层页面跳转到 登录页面
        }
    });
</script>

</html>